home *** CD-ROM | disk | FTP | other *** search
- Path: erich.triumf.ca!bennett
- From: bennett@erich.triumf.ca (P.Bennett)
- Newsgroups: comp.lang.c
- Subject: Re: Writing to a Memory Address
- Date: 4 Apr 1996 07:53 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <4APR199607530406@erich.triumf.ca>
- References: <4k001p$dqb@netnews.upenn.edu>
- NNTP-Posting-Host: ftp.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <4k001p$dqb@netnews.upenn.edu>, mchyzer@red.seas.upenn.edu (Michael C Hyzer) writes...
- >Hello,
- >I am running the same gcc for DOS on my pentium desktop and 386 laptop.
- >I am trying to write to the address of the parallel port (0x0378 on both
- >machines). When i do it on the desktop, with a command such as:
- >
- >int *para = (char *)0x0378;
- >
-
- The I/O ports are _not_ in the normal memory address space. Intel processors
- have a separate I/O address space that can be accessed only by the assmebly
- language IN and OUT instructions, and not by normal memory access instructions.
-
- Borland provides inportb() and outportb() functions to access the I/O ports
- (Microsoft calls theirs inp() and outp())
-
- You will have to see if gcc provides some equivalent function, or do a little
- assembly programming...
-
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
- or: ftp://ftp-i2.informatik.rwth-aachen.de/pub/arnd/GPS/peter/index.html
-
-
-
-
-
-
-